COMMONDIR=./src/
TIME=$(shell date +'%Y%m%d')
OBJ=./bin/

CC=g++

INCLUDE=-I. -I/usr/include/
LIB=-lstdc++ -lrt -lpthread -lboost_program_options -L/usr/local/lib -llog4cplus -lboost_thread -levent
LOG=-DLOGGER -D_DEBUG

CFLAGS=-Wall -g $(INCLUDE) $(LOG)
CPPFLAGS=$(CFLAGS) 


COMMONSRC=$(wildcard $(COMMONDIR)*.cpp)

COMMONOBJ=$(patsubst %.cpp,%.o,$(COMMONSRC))

COMMONDEP=$(patsubst %.cpp,%.d,$(COMMONSRC))


all:$(OBJ)Bncf

$(OBJ)Bncf : $(COMMONOBJ)
	$(CC) $^ $(CFLAGS) -o $@ $(LIB) 

clean:
	rm $(COMMONDIR)*.o -fv
	rm $(COMMONDIR)*.d -fv

clear:
	rm $(COMMONDIR) -fv

rebuild clean all:

-include $(COMMONDEP)
